package com.wen.wenproducer;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author wenl
 * @version V2.0
 * @project 自己的框架
 * @package com.wen.wenproducer
 * @date 2020/3/27
 * @describe
 */

@RestController
@RequestMapping("/hello")
//@RefreshScope
public class HelloController {

    @Value("${user.name}")
    String userName;

    @Value("${user.age}")
    int age;

    @GetMapping("/")
    public String hello(String name){
        return userName+"-"+age+".   Hello, "+name+" "+new Date();
    }

}
